package com.mapper;

import com.pojo.SClass;
import com.pojo.SStudent;
import com.pojo.TbUser;
import com.pojo.Worker;
import org.apache.ibatis.annotations.*;

/**
* @author 海棠凤梨
* @description 针对表【s_class】的数据库操作Mapper
* @createDate 2024-11-20 09:38:15
* @Entity com.pojo.SClass
*/
public interface SClassMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SClass record);

    int insertSelective(SClass record);

    SClass selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SClass record);

    int updateByPrimaryKey(SClass record);

    @Select("select * from c_class where id = #{id}")
    @Results({
            @Result(id = true, column = "id",property = "id"),
            @Result(column = "classname",property = "classname"),
            @Result(column = "id",property = "studentsList",
                    many = @Many(select = "com.mapper.StudentsMapper.selectClassById"))
    })
    SClass selectClassById(int id);
}
